package com.zhiche.lisa.bms.enums;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author linbao
 * @date 2018-11-06
 */
public enum ActivitiEnum {
    ACTIVITI_NAME("quoteConfirm", "报价单溢价率审批流"),
    /**
     * 支付申请单审核
     */
    ACTIVITI_PAY_APPLY_NAME("payApplyConfirm", "支付申请单审批流"),

    ACTIVITI_TEMP_QUOTE_NAME("tempQuote", "临时报价单单审批流"),

    CONDITION_TYPE_1("1", "条件1, 0<比例L≤3%"),
    CONDITION_TYPE_2("2", "条件2, 3<比例L≤5"),
    CONDITION_TYPE_3("3", "条件3, 比例>5%"),

    FOUR_CONDITION("4", "其他"),
    FIVE_CONDITION("5", "其他"),
    SIX_CONDITION("6", "其他"),

    TMEP_QUOTE_RATE_1("1", "0<溢价比<4.99%"),
    TMEP_QUOTE_RATE_2("2", "溢价比>=5%"),

    COMMON_QUOTE_CONDITION("type", "大合同报价单的溢价比判断"),
    TEMP_QUOTE_CONDITION("rateType", "临时报价单的溢价比判断"),
    // 2019-07-12 -
    CON_QUOTE_CONDITION("accountUser", "正式报价单的溢价比判断"),

    // new
    KUAIJI_NAME_CONDITION("name", "经营会计"),

    RUWX_WENWEN_RENYI("ruwx,wenwen,renyi", "茹文旭or文雯or任一"),
    RUWX_WENWEN_RENYI_TASK_ID("ruwenxuAndwenwenAndrenyiConfirm", "茹文旭or文雯or任一"),
    SHIYH_TASK_CONFIRM("shiyh", "施永鸿审核"),
    DAILIJUN_TASK_CONFIRM("dailj", "戴丽君审核"),
    JIANGTIANXIANG_TASK_CONFIRM("jiangtx", "蒋天祥审核"),


    PAY_APPLY_START_FLEET_TYPE("startFleetType", "支付申请单判断正式临时"),

    JIESUAN_CONDITION("jiesuan", "结算判断条件, 孟凡娇or赵芬"),

    JIESUAN_CONDITION_TYPE_1("1", "孟凡娇审核"),
    JIESUAN_CONDITION_TYPE_2("2", "赵芬审核"),

    JIESUAN_MENTFJ("mengfj", "孟凡娇审核"),
    JIESUAN_ZHAOFEN("zhaofen", "赵芬审核"),

    JIESUAN_OR_MENGFANJIAO_MFJ_ZF("mengfj,zhaofen", "孟凡娇,赵芬TASK"),
    MFJ_OR_ZF_TASK_ID("mfjOrzfConfirmTask", "孟凡娇,赵芬TASK_ID"),

    WYL_OR_XW_OR_ZF("linyn2,leiyt,yangting", "林幼暖,雷艳婷,杨婷TASK"),
    WYL_OR_XW_OR_ZF_TASK_ID("lynOrxwOrytConfirmTask", "林幼暖,徐蔚,杨婷TASK_ID"),
    WYL_OR_LYT_OR_ZF_TASK_ID("lynOrlytOrytConfirmTask", "林幼暖,雷艳婷,杨婷TASK_ID"),

    CAIWU_WANYL("linyn2", "林幼暖审核"),
    CAIWU_XUWEI("leiyt", "雷艳婷审核"),
    CAIWU_YANGTING("yangting", "杨婷审核"),

    CAIWU_CONDITION("caiwuType", "财务判断条件, 林幼暖or雷艳婷or章凡"),

    PAY_APPLY_TASK_ID_YANGFANG("yangfang", "支付申请单杨芳"),
    PAY_APPLY_TASK_ID_XUWEI("xuwei", "支付申请单徐蔚"),

    // attribute
    PAY_APPLY_FLLET_CONDITION("attribute", "支付申请单车队的正式和临时的判断"),

    CAIWU_CONDITION_TYPE_1("1", "林幼暖审核"),
    CAIWU_CONDITION_TYPE_2("2", "雷艳婷审核"),
    CAIWU_CONDITION_TYPE_3("3", "杨婷审核"),

    CONTRACT_QUOTE_JIESUAN("waitConfirm", "结算部分审核");

    public static final String ACTIVITI_USER_TASK_TYPE = "userTask";

    /**
     * 大合同的报价单溢价比
     */
    public static final BigDecimal ONE_PREMINUM = new BigDecimal("0.01");
    public static final BigDecimal THREE_PREMINUM = new BigDecimal("0.03");
    public static final BigDecimal FIVE_PREMINUM = new BigDecimal("0.05");

    /**
     * 临时报价单的溢价比
     */
    public static final BigDecimal TEMP_RATE_ONE = new BigDecimal("0.0499");
    public static final BigDecimal TEMP_RATE_TWO = new BigDecimal("0.05");


    public static final String ASSIGNEE_FORM = "待%s审批";

    public static final String HISTORY_ASSIGNEE = "%s审批完成";

    public static final String FINISH_ASSIGNEE = "已完成审批";

    public static final String ADUST_FAIL = "%s审批不通过, %s";

    /**
     * 报价单作废
     */
    public static final String QUOTE_BACK_OUT = "报价单作废";

    public static final String CURRENT_USER_ID = "currentUserId";
    public static final String CURRENT_USER_NAME = "currentUserName";

    public static final List<String> quoteConfirmList = Lists.newArrayList();
    public static final List<String> conQuoteConfirmList = Lists.newArrayList();

    public static final List<String> payApplyConfirmList = Lists.newArrayList();

    static {
        // 史永生
        // quoteConfirmList.add("shiys");
        // // 戴丽君
        // quoteConfirmList.add("dailj");
        // // 茹文旭
        // quoteConfirmList.add("ruwx");
        // // 文雯
        // quoteConfirmList.add("wenwen");
        // 任一
        // quoteConfirmList.add("renyi");
        // // 孙迎宏
        // quoteConfirmList.add("sunyh");
        // // 蒋天祥
        // quoteConfirmList.add("jiangtx");
        // 正式报价单
        // 李锐先
        conQuoteConfirmList.add("lirx");

        // 结算人员
        conQuoteConfirmList.add("houwq");
        // 吴丹
        conQuoteConfirmList.add("wudan");
        // 刘何青
        conQuoteConfirmList.add("liuhq");
        // 王敏
        conQuoteConfirmList.add("wangmin");
        // 杨楠茜
        conQuoteConfirmList.add("yangnq");
        // 赵芬
        conQuoteConfirmList.add("zhaofen");
        // 孟凡娇
        conQuoteConfirmList.add("mengfj");
        // 何洁
        conQuoteConfirmList.add("hejie1");


        // 施永鸿
        // quoteConfirmList.add("shiyh");
        // 临时报价单
        // 潘坤
        quoteConfirmList.add("hujie");
        // 祝伟
        quoteConfirmList.add("zhuwei");
        // // 临时报价单
        // // 史永生
        // quoteConfirmList.add("shiys");
        // // 左祥艳
        // quoteConfirmList.add("zuoxy");

        payApplyConfirmList.add("mengfj");
        payApplyConfirmList.add("zhaofen");
        // payApplyConfirmList.add("xieyu");
        payApplyConfirmList.add("linyn2");
        payApplyConfirmList.add("xuwei");
        payApplyConfirmList.add("yangting");
        payApplyConfirmList.add("leiyt");
        // payApplyConfirmList.add("yangfang");
        payApplyConfirmList.add("dailj");
    }

    public static final Map<String, Integer> kuaijiMap = Maps.newHashMap();

    static {
        kuaijiMap.put("ruwx", 1);
        kuaijiMap.put("wenwen", 2);
        kuaijiMap.put("renyi", 3);
    }

    private final String code;

    private final String value;

    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    ActivitiEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public static String getAccountUser(String userCode) {
        String accountCode = "0";
        switch (userCode) {
            case "houwq":
                accountCode = "1";
                break;
            case "wudan":
                accountCode = "2";
                break;
            case "liuhq":
                accountCode = "3";
                break;
            case "wangmin":
                accountCode = "4";
                break;
            case "yangnq":
                accountCode = "5";
                break;
            case "zhaofen":
                accountCode = "6";
                break;
            case "mengfj":
                accountCode = "7";
                break;
            case "lirx":
                accountCode = "8";
                break;
            case "hejie1":
                accountCode = "9";
                break;
        }
        return accountCode;
    }
}
